package ch.fusun.baron.basic.client.ui;

import ch.fusun.baron.basic.command.CreateCityCommand;
import ch.fusun.baron.client.rmi.ClientService;
import ch.fusun.baron.client.ui.messages.Messages;
import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.core.service.UserService;
import ch.fusun.baron.map.Tile;
import ch.fusun.baron.player.api.PlayerService;

/**
 * 
 */
public class CreateCityTileAction extends AbstractTileAction {

	@Inject
	private PlayerService playerService;
	@Inject
	private UserService userService;
	@Inject
	private ClientService clientService;

	/**
	 * Injection constructor
	 */
	public CreateCityTileAction() {

	}

	@Override
	public void execute(Object tile) {
		clientService.execute(new CreateCityCommand(playerService
				.getDynasty(userService.getUser()), (Tile) tile));
	}

	@Override
	public Class<?> getReactionClass() {
		return Tile.class;
	}

	@Override
	public String getText() {
		return Messages.CreateCityTileAction_Description;
	}

}
